(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    const { exec } = require('child_process');
    async function getBatteryReport() {
        const command = 'chcp 65001 && Powercfg/batteryreport';
        return new Promise((resolve, reject) => {
            exec(command, (error, stdout, stderr) => {
                if (error) {
                    console.error(`错误: ${error.message}`);
                    return null;
                }
                if (stderr) {
                    console.error(`stderr: ${stderr}`);
                    return null;
                }
                const result = stdout.split('\n');
                const pathLine = result[1].trim();
                const path = pathLine.substring(17, pathLine.length - 1);
                resolve(path);
            });
        });
    }
    exports.default = getBatteryReport;
});
